<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="关系型数据库,非关系型数据库,sql,MySQL,">










<meta name="description" content="目的： 认识什么是SQL 认识什么是关系型数据库和非关系型数据库，两者都包含哪些种类的数据库；并且理解两者之间的区别。 学习一种关系型数据库的操作，包括（对数据库和数据表的增、删、改、查）。  背景知识：SQL简介​        SQL结构化查询语言，是一种数据库查询和程序设计语言，用于存取数据以及查询、更新和管理关系数据库系统。 关系型数据库和非关系型数据库关系型数据库​        关系型">
<meta name="keywords" content="关系型数据库,非关系型数据库,sql,MySQL">
<meta property="og:type" content="article">
<meta property="og:title" content="认识SQL并学习数据库的基础操作">
<meta property="og:url" content="https://gitee.com/blghost/blog.git/2019/09/26/认识sql并学习数据库的基础操作/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="目的： 认识什么是SQL 认识什么是关系型数据库和非关系型数据库，两者都包含哪些种类的数据库；并且理解两者之间的区别。 学习一种关系型数据库的操作，包括（对数据库和数据表的增、删、改、查）。  背景知识：SQL简介​        SQL结构化查询语言，是一种数据库查询和程序设计语言，用于存取数据以及查询、更新和管理关系数据库系统。 关系型数据库和非关系型数据库关系型数据库​        关系型">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570340994643.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570341400561.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570341415611.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342162845.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342255410.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342332783.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342609678.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342751654.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342861670.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342978908.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343040604.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343801463.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343872549.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570345753835.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346198941.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346249772.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346277790.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346315202.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346333330.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346567689.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346615715.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346892515.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570347113403.png">
<meta property="og:image" content="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps1.jpg">
<meta property="og:image" content="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps2.jpg">
<meta property="og:image" content="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps3.jpg">
<meta property="og:image" content="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps4.jpg">
<meta property="og:updated_time" content="2019-11-02T11:55:15.463Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="认识SQL并学习数据库的基础操作">
<meta name="twitter:description" content="目的： 认识什么是SQL 认识什么是关系型数据库和非关系型数据库，两者都包含哪些种类的数据库；并且理解两者之间的区别。 学习一种关系型数据库的操作，包括（对数据库和数据表的增、删、改、查）。  背景知识：SQL简介​        SQL结构化查询语言，是一种数据库查询和程序设计语言，用于存取数据以及查询、更新和管理关系数据库系统。 关系型数据库和非关系型数据库关系型数据库​        关系型">
<meta name="twitter:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570340994643.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://gitee.com/blghost/blog.git/2019/09/26/认识sql并学习数据库的基础操作/">





  <title>认识SQL并学习数据库的基础操作 | Hexo</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Hexo</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/blghost/blog.git/blog/2019/09/26/认识sql并学习数据库的基础操作/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Blackghost">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hexo">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">认识SQL并学习数据库的基础操作</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-09-26T00:13:08+08:00">
                2019-09-26
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="目的："><a href="#目的：" class="headerlink" title="目的："></a>目的：</h2><ol>
<li>认识什么是SQL</li>
<li>认识什么是关系型数据库和非关系型数据库，两者都包含哪些种类的数据库；并且理解两者之间的区别。</li>
<li>学习一种关系型数据库的操作，包括（对数据库和数据表的增、删、改、查）。</li>
</ol>
<h2 id="背景知识："><a href="#背景知识：" class="headerlink" title="背景知识："></a>背景知识：</h2><h3 id="SQL简介"><a href="#SQL简介" class="headerlink" title="SQL简介"></a>SQL简介</h3><p>​        SQL结构化查询语言，是一种数据库查询和程序设计语言，用于存取数据以及查询、更新和管理关系数据库系统。</p>
<h3 id="关系型数据库和非关系型数据库"><a href="#关系型数据库和非关系型数据库" class="headerlink" title="关系型数据库和非关系型数据库"></a>关系型数据库和非关系型数据库</h3><h4 id="关系型数据库"><a href="#关系型数据库" class="headerlink" title="关系型数据库"></a>关系型数据库</h4><p>​        关系型数据库是指采用了关系模型来组织数据的数据库，关系模型可以简单理解为二维表格模型，而一个关系型数据库就是由二维表及其之间的关系组成的一个数据组。<strong>常见的关系型数据库有：Oracle、SQLServer、DB2、Mysql。</strong></p>
<h4 id="非关系型数据库"><a href="#非关系型数据库" class="headerlink" title="非关系型数据库"></a>非关系型数据库</h4><p>​        非关系型数据库NoSQL是没有使用关系模型组织数据的数据库，数据之间无关系性，非关系数据库针对不同的数据的特点以不同的方式存储数据，常见的有如下：<strong>键值、列存储、文档型、图形。</strong></p>
<hr>
<h5 id="键值存储数据库："><a href="#键值存储数据库：" class="headerlink" title="键值存储数据库："></a>键值存储数据库：</h5><p>​        这一类数据库主要会使用一个哈希表，表中有一个特定的键和一个指针指向特定的数据。如：<strong><em>Aerospike, Apache Ignite, ArangoDB, Berkeley DB, Couchbase, Dynamo, FoundationDB, InfinityDB, MemcacheDB, MUMPS, Oracle NoSQL Database, OrientDB, Redis, Riak, SciDB, SDBM/Flat File dbm,ZooKeeper。</em></strong></p>
<hr>
<h5 id="列式存储数据库："><a href="#列式存储数据库：" class="headerlink" title="列式存储数据库："></a>列式存储数据库：</h5><p>​        列式数据库是以列相关存储架构进行数据存储的数据库，主要适合于批量数据的处理和即时查询。常见的有：<strong><em>Accumulo, Cassandra, Scylla, HBase。</em></strong></p>
<hr>
<h5 id="文档数据库："><a href="#文档数据库：" class="headerlink" title="文档数据库："></a>文档数据库：</h5><p>​        文档数据库区别于传统的其它数据库，它是用来管理文档；一个文档相当于关系数据库中的一条记录。使用该类型的数据库有：<strong><em>Apache CouchDB, ArangoDB, BaseX, Clusterpoint, Couchbase, Cosmos DB, IBM Domino, MarkLogic, MongoDB, OrientDB, Qizx, RethinkDB</em></strong></p>
<hr>
<h5 id="图形数据库："><a href="#图形数据库：" class="headerlink" title="图形数据库："></a>图形数据库：</h5><p>​        图形数据库是NoSQL数据库的一种类型，它应用图形理论存储实体之间的关系信息。图形数据库是一种非关系型数据库，它应用图形理论存储实体之间的关系信息。用该类型的数据库有：<strong><em>AllegroGraph, ArangoDB, InfiniteGraph, Apache Giraph, MarkLogic, Neo4J, OrientDB, Virtuoso</em></strong></p>
<hr>
<h4 id="两者之间的区别"><a href="#两者之间的区别" class="headerlink" title="两者之间的区别"></a><strong>两者之间的区别</strong></h4><p><strong>关系型数据库：</strong></p>
<table>
<thead>
<tr>
<th align="center">优点</th>
<th align="center">缺点</th>
</tr>
</thead>
<tbody><tr>
<td align="center">易于理解：结构化的数据存储（行列表）</td>
<td align="center">读写性能差，在大数据环境下更为明显</td>
</tr>
<tr>
<td align="center">便于操作：通用的SQL语言</td>
<td align="center">采用固定的表结构，导致可扩展性差</td>
</tr>
<tr>
<td align="center">实现单表及多表的复杂查询</td>
<td align="center"></td>
</tr>
</tbody></table>
<p><strong>非关系型数据库：</strong></p>
<table>
<thead>
<tr>
<th align="center">优点</th>
<th align="center">缺点</th>
</tr>
</thead>
<tbody><tr>
<td align="center">数据存储格式多样、灵活、扩展性强</td>
<td align="center">没有统一的数据管理语言，学习成本高</td>
</tr>
<tr>
<td align="center">读写速度快</td>
<td align="center">不支持多表的查询和操作</td>
</tr>
<tr>
<td align="center">部署和维护成本低</td>
<td align="center">对数据的管理不方便</td>
</tr>
</tbody></table>
<h2 id="数据库管理的基本操作"><a href="#数据库管理的基本操作" class="headerlink" title="数据库管理的基本操作"></a>数据库管理的基本操作</h2><h3 id="以Root身份登录MySQL"><a href="#以Root身份登录MySQL" class="headerlink" title="以Root身份登录MySQL"></a>以Root身份登录MySQL</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -u root -p 密码</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570340994643.png" alt="1570340994643"></p>
<h3 id="创建新用户"><a href="#创建新用户" class="headerlink" title="创建新用户"></a>创建新用户</h3><p>添加一条记录，用户名为guest，密码为guest123,并授权SELECT、INSERT、UPDATE权限</p>
<h4 id="方法一："><a href="#方法一：" class="headerlink" title="方法一："></a>方法一：</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">CREATE USER &apos;newuser&apos;@&apos;localhost&apos; #@后面跟着的是主机名，可以是远程服务器:www.server.com</span><br><span class="line">  IDENTIFIED BY &apos;user-password&apos;;</span><br><span class="line">GRANT INSERT,SELECT     #用户的权限，这里分配了插入和选择缺陷，使用所有权限 ALL（不推荐）</span><br><span class="line">  ON *.*				#全部数据库和表，可以指定数据库和表：database.* 或者 db.tablename</span><br><span class="line">  TO &apos;newuser&apos;@&apos;localhost&apos;</span><br><span class="line">  WITH GRANT OPTION; #具有授于其它用户权限的能力，授予权限仅限于自己被授予的权限，一般不用该选项</span><br></pre></td></tr></table></figure>

<h4 id="方法二："><a href="#方法二：" class="headerlink" title="方法二："></a>方法二：</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">insert into user (host,user,password,select_priv,insert_priv,update_priv)values(&apos;localhost&apos;,&apos;guest&apos;,passwrod(&apos;guest123&apos;),&apos;y&apos;,&apos;y&apos;,&apos;y&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570341400561.png" alt="1570341400561"></p>
<p>查看是否创建成功！</p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570341415611.png" alt="1570341415611"></p>
<p>通用的步骤（新用户的授权信息更新）：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">FLUSH PRIVILEGES;</span><br></pre></td></tr></table></figure>

<h4 id="注意事项："><a href="#注意事项：" class="headerlink" title="注意事项："></a>注意事项：</h4><ol>
<li><p>在MySQL5.7中user表的password已换成了authentication_string。</p>
</li>
<li><p>Password()加密函数已经在8.0.11中移除了，可以使用md5()函数代替。在添加新用户的时候需要执行flush privileges语句。这个命令执行后会重新载入授权表。如果你不使用该命令，你就无法使用新创建的用户来连接mysql服务器，除非重启mysql服务器。</p>
</li>
</ol>
<hr>
<h3 id="查看数据库信息"><a href="#查看数据库信息" class="headerlink" title="查看数据库信息"></a>查看数据库信息</h3><h4 id="在MySQL中查看，当前所有的用户和连接的主机和密码"><a href="#在MySQL中查看，当前所有的用户和连接的主机和密码" class="headerlink" title="在MySQL中查看，当前所有的用户和连接的主机和密码"></a>在MySQL中查看，当前所有的用户和连接的主机和密码</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select host,user,password from mysql.user;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342162845.png" alt="1570342162845"></p>
<h4 id="查看当前用户"><a href="#查看当前用户" class="headerlink" title="查看当前用户"></a>查看当前用户</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select user();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342255410.png" alt="1570342255410"></p>
<h4 id="查看所有数据库"><a href="#查看所有数据库" class="headerlink" title="查看所有数据库"></a>查看所有数据库</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show databases;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342332783.png" alt="1570342332783"></p>
<h4 id="查看数据库中所有表"><a href="#查看数据库中所有表" class="headerlink" title="查看数据库中所有表"></a>查看数据库中所有表</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show tables from testdb;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342609678.png" alt="1570342609678"></p>
<p>或者先使用testdb这个数据库，然后再使用show tables这个命令。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">use testdb;</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show tables;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342751654.png" alt="1570342751654"></p>
<h4 id="查看表的信息"><a href="#查看表的信息" class="headerlink" title="查看表的信息"></a>查看表的信息</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">desc test1;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342861670.png" alt="1570342861670"></p>
<h4 id="查看当前用户权限"><a href="#查看当前用户权限" class="headerlink" title="查看当前用户权限"></a>查看当前用户权限</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show GRANTS;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570342978908.png" alt="1570342978908"></p>
<h4 id="查看MySQL版本"><a href="#查看MySQL版本" class="headerlink" title="查看MySQL版本"></a>查看MySQL版本</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select @@version</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343040604.png" alt="1570343040604"></p>
<h3 id="数据库操作"><a href="#数据库操作" class="headerlink" title="数据库操作"></a>数据库操作</h3><h4 id="库操作"><a href="#库操作" class="headerlink" title="库操作"></a>库操作</h4><p>创建一个名为test的数据库，并且使用它。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">create database test</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">use test</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343801463.png" alt="1570343801463"></p>
<p>删除数据库</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">drop database test;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570343872549.png" alt="1570343872549"></p>
<h4 id="表操作"><a href="#表操作" class="headerlink" title="表操作"></a>表操作</h4><p>创建一个表</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">create table table_name(</span><br><span class="line">	column1 数据类型[约束],</span><br><span class="line">	column2 数据类型[约束],</span><br><span class="line">	……</span><br><span class="line">)</span><br></pre></td></tr></table></figure>

<p>约束可选项，SQL约束和MySQL数据类型见附录。</p>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">create table test1(</span><br><span class="line">	id int not null primary key auto_increment,</span><br><span class="line">	name varchar(20) not null,</span><br><span class="line">	time datetime </span><br><span class="line">);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570345753835.png" alt="1570345753835"></p>
<p>删除表</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">drop table runoob;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346198941.png" alt="1570346198941"></p>
<p>修改表</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">alter table 表名 add 列名 类型;#添加一列</span><br><span class="line">alter table 表名 drop 列名; #删除一列</span><br><span class="line">alter table 表名 modify column 列名 类型 #修改列的数据类型</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346249772.png" alt="1570346249772"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346277790.png" alt="1570346277790"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346315202.png" alt="1570346315202"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346333330.png" alt="1570346333330"></p>
<h4 id="数据的操作"><a href="#数据的操作" class="headerlink" title="数据的操作"></a>数据的操作</h4><p>增加一条数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">insert into test1(id,time,sex)values(1,&apos;2019-10-6&apos;,&apos;ma&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346567689.png" alt="1570346567689"></p>
<p>查询数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select * from test1</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346615715.png" alt="1570346615715"></p>
<p>更改一条数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">update test1 set sex=&apos;v1&apos; where id =1;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570346892515.png" alt="1570346892515"></p>
<p>删除一条数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">delete from test1 where id =1;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1570347113403.png" alt="1570347113403"></p>
<h4 id="补充"><a href="#补充" class="headerlink" title="补充"></a>补充</h4><p>​        where子句：用来查询语句中，你可以使用一个或多个表，表之间使用逗号，分割，并使用WHERE语句来设定查询条件；可以使用AND或OR指定一个或多个条件。WHERE子句也可以运用于SQL的DELETE或者UPDATE命令。</p>
<p>​        like子句：有时候我们需要查询字段中的某段记录的字符，这时我们就需要在where子句中使用like子句。子句中使用百分号%字符来表示任意字符。like匹配/模糊匹配使用方法如下：</p>
<table>
<thead>
<tr>
<th align="center"><strong>“%a” //以a结尾的数据</strong></th>
<th align="center">“下划线（—）a下划线（—）”    //三位且中间字母是a</th>
</tr>
</thead>
<tbody><tr>
<td align="center"><strong>“a%” //以a开头的数据</strong></td>
<td align="center"><strong>“下划线（—）a”    //两位且结尾字母是a</strong></td>
</tr>
<tr>
<td align="center"><strong>“%a%” //含有a的数据</strong></td>
<td align="center"><strong>“a下划线（—）”    //两位且开头字母是a</strong></td>
</tr>
</tbody></table>
<p>​        union操作符：是用于连接两个以上的SELECT语句的结果组合到一个结果集合中。多个select语句会删除重复的数据Union后面的（两个可选参数DISTINCT：可选，删除结果中的重复数据。默认是这个；ALL：可选，返回结果中的所有数据，包括重复的。）</p>
<h3 id="附录"><a href="#附录" class="headerlink" title="附录"></a>附录</h3><h4 id="MySQL数据类型"><a href="#MySQL数据类型" class="headerlink" title="MySQL数据类型"></a>MySQL数据类型</h4><p>Mysql中定义数据字段的类型对你数据库的优化是非常重要的。</p>
<p>MySQL支持多种数据类型，大致可以分为三类：数值、日期/时间和字符串（字符）类型。</p>
<h5 id="数值类型："><a href="#数值类型：" class="headerlink" title="数值类型："></a><strong>数值类型：</strong></h5><p>MySQL支持所有标准SQL数值数据类型。</p>
<p>这些类型包括严格数值数据类型（INTEGER、SMALLINT、DECIMAL和NUMERIC），以及近似数值数据类型（FLOAT、REAL和DOUBLe precision）。</p>
<p>关键字INT是INTEGER的同义词，关键词DEC是DECIMAL的同义词BIT数据类型保存字段值，并且支持MyISAM、MEMORY、InNoDB和BDB表</p>
<p>作为SQL标准的扩展，MYSQL也支持整数类型TINYINT、MEDIUMINT和BIGINT下面的表显示了需要的每个整数类型的存储和范围。</p>
<p><img src="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps1.jpg" alt="img"> </p>
<h5 id="日期和时间类型："><a href="#日期和时间类型：" class="headerlink" title="日期和时间类型："></a><strong>日期和时间类型：</strong></h5><p>表示时间值的日期和时间类型为DATATIME、DATE、TIMESTAMP、TIME和YEAR</p>
<p>每个时间类型有一个有效值范围和一个‘零’值，当指定不合法的MySQL不能表示的值使用‘零’值。TIMESTAMP类型有专有的自动更新特性，将在后面描述。</p>
<p><img src="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps2.jpg" alt="img"> </p>
<h5 id="字符串类型："><a href="#字符串类型：" class="headerlink" title="字符串类型："></a><strong>字符串类型：</strong></h5><p>字符串类型指：char、varchar、binary、varbinary、blob、text、enum和set。该节描述了这些类型如何工作以及如何在查询中使用这些类型。</p>
<p><img src="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps3.jpg" alt="img"> </p>
<p>Char和varchar类型类似，但它们保存和检索的方式不同。它们的最大长度和是否尾部空格被保留等方面也不同。在存储或检索过程中不进行大小写转换。</p>
<p>BINARY和VARBINARY类似于char和varchar，不同的是它们包含二进制字符串而不要非二进制字符串。它们包含字符串而不是字符字符串。这说明它们没有字符集，并且排序和比较基于列值字节的数值</p>
<p>BLOB是一个二进制大对象可以容纳可变数量的数据。有4种BLOB类型：TINYBLOB、BLOB、MEDIUMBLOB和LONGBLOB。它们区别在于可容纳存储范围不同。</p>
<p>有4中TEXT类型：TINYTEXT、TEXT、MEDIUTEXT和LONGTEXT。对应的这4种BLOB类型，可存储的最大长度不同，可根据实际情况选择。</p>
<h4 id="RDBMS术语"><a href="#RDBMS术语" class="headerlink" title="RDBMS术语"></a><strong>RDBMS术语</strong></h4><p>在开始学习MySQL数据库前，先了解一些术语：</p>
<p>数据库：数据库是一些关联表的集合，可以理解为装数据表的一个盒子</p>
<p>数据表：表示数据的矩阵。在一个数据库中变的表看起来像一个简单的电子表格</p>
<p>列：一列（数据元素）包含了相同类型的数据，例如邮政编码的数据。</p>
<p>行：一行（=元祖，或记录）是一组相关的数据，例如一条用户订阅的数据。</p>
<p>冗余：存储两倍数据，冗余降低了性能，但提高了数据的安全。</p>
<p>主键：主键是唯一的。一个数据表中只能包含一个主键，你可以使用主键来查询数据。</p>
<p>外键：外键用于关联两个表。</p>
<p>复合键：复合键又称（组合键）将多个列作为一个索引键，一般用于复合索引。</p>
<p>索引：使用索引可以快速访问数据库表中的特定信息。索引是对数据库表中一列或者多列的值进行排序的一种结构。类似于书籍的目录。</p>
<p>参照完整性：参照的完整性要求关系中不允许引用不存在的实体。与实体完整性是关系模型必须满足的完整性约束条件，目的是保证数据的一致性。</p>
<p><img src="file:///C:%5CUsers%5Cadmin%5CAppData%5CLocal%5CTemp%5Cksohtml8744%5Cwps4.jpg" alt="img"> </p>
<p>表头：每一列的名称</p>
<p>列：具有相同数据类型的数据的集合</p>
<p>行：每一行用来描述某条记录的具体信息</p>
<p>值：行的具体信息，每个值必须与该列的数据类型相同</p>
<p>键：键的值在当前列中具有唯一性。</p>
<h3 id="参考连接："><a href="#参考连接：" class="headerlink" title="参考连接："></a>参考连接：</h3><p><a href="https://baike.baidu.com/item/%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/8999831?fr=aladdin" target="_blank" rel="noopener">关系型数据库</a></p>
<p><a href="https://baike.baidu.com/item/NoSQL/8828247?fromtitle=%E9%9D%9E%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93&fromid=6376860&fr=aladdin" target="_blank" rel="noopener">非关系型数据库</a></p>
<p><a href="https://www.runoob.com/mysql/mysql-tutorial.html" target="_blank" rel="noopener">MySQL数据库</a></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/关系型数据库/" rel="tag"># 关系型数据库</a>
          
            <a href="/blog/tags/非关系型数据库/" rel="tag"># 非关系型数据库</a>
          
            <a href="/blog/tags/sql/" rel="tag"># sql</a>
          
            <a href="/blog/tags/MySQL/" rel="tag"># MySQL</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2019/09/04/环境搭建/" rel="next" title="成长日记第一篇">
                <i class="fa fa-chevron-left"></i> 成长日记第一篇
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2019/10/07/数据库系统表相关学习/" rel="prev" title="数据库系统表相关学习">
                数据库系统表相关学习 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Blackghost</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#目的："><span class="nav-number">1.</span> <span class="nav-text">目的：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#背景知识："><span class="nav-number">2.</span> <span class="nav-text">背景知识：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#SQL简介"><span class="nav-number">2.1.</span> <span class="nav-text">SQL简介</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#关系型数据库和非关系型数据库"><span class="nav-number">2.2.</span> <span class="nav-text">关系型数据库和非关系型数据库</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#关系型数据库"><span class="nav-number">2.2.1.</span> <span class="nav-text">关系型数据库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#非关系型数据库"><span class="nav-number">2.2.2.</span> <span class="nav-text">非关系型数据库</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#键值存储数据库："><span class="nav-number">2.2.2.1.</span> <span class="nav-text">键值存储数据库：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#列式存储数据库："><span class="nav-number">2.2.2.2.</span> <span class="nav-text">列式存储数据库：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#文档数据库："><span class="nav-number">2.2.2.3.</span> <span class="nav-text">文档数据库：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#图形数据库："><span class="nav-number">2.2.2.4.</span> <span class="nav-text">图形数据库：</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#两者之间的区别"><span class="nav-number">2.2.3.</span> <span class="nav-text">两者之间的区别</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#数据库管理的基本操作"><span class="nav-number">3.</span> <span class="nav-text">数据库管理的基本操作</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#以Root身份登录MySQL"><span class="nav-number">3.1.</span> <span class="nav-text">以Root身份登录MySQL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#创建新用户"><span class="nav-number">3.2.</span> <span class="nav-text">创建新用户</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#方法一："><span class="nav-number">3.2.1.</span> <span class="nav-text">方法一：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#方法二："><span class="nav-number">3.2.2.</span> <span class="nav-text">方法二：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#注意事项："><span class="nav-number">3.2.3.</span> <span class="nav-text">注意事项：</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#查看数据库信息"><span class="nav-number">3.3.</span> <span class="nav-text">查看数据库信息</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#在MySQL中查看，当前所有的用户和连接的主机和密码"><span class="nav-number">3.3.1.</span> <span class="nav-text">在MySQL中查看，当前所有的用户和连接的主机和密码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看当前用户"><span class="nav-number">3.3.2.</span> <span class="nav-text">查看当前用户</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看所有数据库"><span class="nav-number">3.3.3.</span> <span class="nav-text">查看所有数据库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看数据库中所有表"><span class="nav-number">3.3.4.</span> <span class="nav-text">查看数据库中所有表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看表的信息"><span class="nav-number">3.3.5.</span> <span class="nav-text">查看表的信息</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看当前用户权限"><span class="nav-number">3.3.6.</span> <span class="nav-text">查看当前用户权限</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看MySQL版本"><span class="nav-number">3.3.7.</span> <span class="nav-text">查看MySQL版本</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数据库操作"><span class="nav-number">3.4.</span> <span class="nav-text">数据库操作</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#库操作"><span class="nav-number">3.4.1.</span> <span class="nav-text">库操作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#表操作"><span class="nav-number">3.4.2.</span> <span class="nav-text">表操作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#数据的操作"><span class="nav-number">3.4.3.</span> <span class="nav-text">数据的操作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#补充"><span class="nav-number">3.4.4.</span> <span class="nav-text">补充</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#附录"><span class="nav-number">3.5.</span> <span class="nav-text">附录</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#MySQL数据类型"><span class="nav-number">3.5.1.</span> <span class="nav-text">MySQL数据类型</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#数值类型："><span class="nav-number">3.5.1.1.</span> <span class="nav-text">数值类型：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#日期和时间类型："><span class="nav-number">3.5.1.2.</span> <span class="nav-text">日期和时间类型：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#字符串类型："><span class="nav-number">3.5.1.3.</span> <span class="nav-text">字符串类型：</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#RDBMS术语"><span class="nav-number">3.5.2.</span> <span class="nav-text">RDBMS术语</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考连接："><span class="nav-number">3.6.</span> <span class="nav-text">参考连接：</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Blackghost</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
